你需要替换掉huanf-xue-content\xue-content-api\src\main\java\com\huanf\content\api\CourseBaseInfoController.java

package com.huanf.content.api;

import com.huanf.base.model.PageParams;
import com.huanf.base.model.PageResult;
import com.huanf.content.feignclient.SearchServiceClient;
import com.huanf.content.service.CourseBaseService;
import com.huanf.content.util.SecurityUtil;
import com.huanf.domain.dto.AddCourseDto;
import com.huanf.domain.dto.CourseBaseInfoDto;
import com.huanf.domain.dto.EditCourseDto;
import com.huanf.domain.dto.QueryCourseParamsDto;
import com.huanf.domain.entity.CourseBase;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: 35238
 * 功能: 课程信息编辑接口
 * 时间: 2024-03-28 21:10
 */
@Api(value = "课程信息编辑",tags = "课程信息编辑")
@RestController
public class CourseBaseInfoController {

    @Autowired
    CourseBaseService courseBaseService;

    @Autowired
    SearchServiceClient searchServiceClient;

    @ApiOperation("课程查询接口")
    //@PreAuthorize("hasAuthority('xc_teachmanager_course_list')")
    @PostMapping("/course/list")
    public PageResult<CourseBase> list(PageParams pageParams, @RequestBody QueryCourseParamsDto dto){
        //取出用户身份
        SecurityUtil.XcUser user = SecurityUtil.getUser();
        String companyId = user.getId();
        PageResult<CourseBase> pageResult = courseBaseService.queryCourseBaseList(companyId, pageParams, dto);
        return pageResult;
    }

    @ApiOperation("新增课程")
    @PostMapping("/course")
    //@Validated注解的作用是开启参数校验，这样AddCourseDto类的@NotEmpty、@Size注解才会生效
    public CourseBaseInfoDto createCourseBase(@Validated @RequestBody AddCourseDto addCourseDto){
        SecurityUtil.XcUser user = SecurityUtil.getUser();
        Long companyId = Long.valueOf(user.getId());
        CourseBaseInfoDto courseBase = courseBaseService.createCourseBase(companyId, addCourseDto);
        return courseBase;
    }

    @ApiOperation("根据课程id查询接口")
    @GetMapping("/course/{courseId}")
    public CourseBaseInfoDto getCourseBaseById(@PathVariable Long courseId){
        CourseBaseInfoDto courseBaseInfo = courseBaseService.getCourseBaseInfo(courseId);
        return courseBaseInfo;
    }

    @ApiOperation("根据课程id删除")
    @DeleteMapping("/course/{courseId}")
    public Boolean delCourseBaseById(@PathVariable Long courseId){
        searchServiceClient.del(String.valueOf(courseId));
        return courseBaseService.removeById(courseId);
    }

    @ApiOperation("修改课程")
    @PutMapping("/course")
    public CourseBaseInfoDto modifyCourseBase(@RequestBody @Validated EditCourseDto editCourseDto){
        SecurityUtil.XcUser user = SecurityUtil.getUser();
        Long companyId = Long.valueOf(user.getId());
        CourseBaseInfoDto courseBaseInfoDto = courseBaseService.updateCourseBase(companyId, editCourseDto);
        return courseBaseInfoDto;
    }

}